package com.learn.life;

import org.springframework.beans.factory.FactoryBean;
import org.springframework.stereotype.Component;

@Component
public class MyFactoryBean implements FactoryBean<User> {

    public MyFactoryBean() {
        System.out.println("MyFactoryBean==============构造器");
    }


    @Override
    public User getObject() throws Exception {
        System.out.println("MyFactoryBean==============getObject");
        return new User();
    }

    @Override
    public Class<?> getObjectType() {
        return User.class;
    }
}
